package per.turtle.system.feign.factory;

import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import per.turtle.system.feign.RemoteFileService;
import per.turtle.system.feign.fallback.RemoteFileFallbackImpl;

/**
 * 文件服务降级处理
 *
 * @author turtle
 */
@Component
public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileService> {

    @Override
    public RemoteFileService create(Throwable throwable) {
        RemoteFileFallbackImpl fallback = new RemoteFileFallbackImpl();
        fallback.setCause(throwable);
        return fallback;
    }

}
